package cn.com.homeyoda.aimate.aihealth.ui.game.record;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import cn.com.homeyoda.aimate.aihealth.R;
import cn.com.homeyoda.aimate.aihealth.ui.game.GameBean;

import java.util.List;

public class GameRecordAdapter extends BaseQuickAdapter<GameBean, BaseViewHolder> {

    public GameRecordAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, GameBean item) {
        holder.setBackgroundRes(R.id.iv_game_circle, item.getImgResId());
        holder.setText(R.id.tv_game_title, item.getTitle());
        holder.setText(R.id.tv_play_date, "时间：" + item.getPlayDate());
        holder.addOnClickListener(R.id.btn_game_analysis);
        holder.setGone(R.id.view_divider, holder.getAdapterPosition() < getItemCount() - 1);
    }

    @Override
    public void setNewData(@Nullable List<GameBean> data) {
        super.setNewData(data);
    }
}
